<div id="newTableModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">新建表</h3>
                <div class="ibox-content padding-left-xs padding-right-xs">
                    <div>
                        <div>
                            <div v-if="newTableInfo.view == 'form'">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">表名</label>
                                    <div class="col-sm-8">
                                        <input v-model="newTableInfo.name" type="text" placeholder="必填，请填写据库名" class="form-control">
                                    </div>
                                    <div class="col-sm-2">
                                        <button class="form-control btn btn-sm" @click="_addCol()">添加</button>
                                    </div>
                                </div>

                                <table class="table table-bordered border-primary" style="white-space:nowrap;table-layout: fixed;word-break:break-all;" width="100%" data-page-size="15">
                                    <thead>
                                        <tr>
                                            <th class="text-center">名称</th>
                                            <th class="text-center">类型</th>
                                            <th class="text-center">长度</th>
                                            <th class="text-center">可空</th>
                                            <th class="text-center">主键</th>
                                            <th class="text-center">默认值</th>
                                            <th class="text-center">说明</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="(item,index) in newTableInfo.cols">
                                            <td class="text-center">
                                                <input type="text" v-model="item.name" class="form-control" style="border: none;" />
                                            </td>
                                            <td class="text-center">
                                                <select class="custom-select" v-model="item.type" style="border: none;">
                                                    <option selected disabled value="">必填，请选择类型</option>
                                                    <option value="varchar">varchar</option>
                                                    <option value="bigint">bigint</option>
                                                    <option value="int">int</option>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <input type="text" v-model="item.len" class="form-control" style="border: none;" />
                                            </td>
                                            <td class="text-center">
                                                <select class="custom-select" v-model="item.isNull" style="border: none;">
                                                    <option value="Y">是</option>
                                                    <option value="N">否</option>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <select class="custom-select" v-model="item.isPrimay" style="border: none;">
                                                    <option value="Y">是</option>
                                                    <option value="N">否</option>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <input type="text" v-model="item.default" class="form-control" style="border: none;" />
                                            </td>
                                            <td class="text-center">
                                                <input type="text" v-model="item.comment" class="form-control" style="border: none;" />
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div v-else>
                                <textarea v-model="newTableInfo.sql" rows="15" class="form-control">
                                </textarea>
                            </div>

                            <div class="ibox-content">

                                <button class="btn btn-primary float-right" type="button" v-on:click="_saveNewTable()">保存</button>
                                <button class="btn btn-white float-right  margin-right" type="button" v-on:click="switchSqlView('sql')" v-if="newTableInfo.view == 'form'">sql视图</button>
                                <button class="btn btn-white float-right  margin-right" type="button" v-on:click="switchSqlView('form')" v-else>设计视图</button>
                                <button type="button" class="btn btn-white float-right margin-right" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>